The present invention relates to event counters and in particular to a method and apparatus for prescaling an event count.
In testing microprocessor code it is often useful to count the number of times various memory storage locations or memory mapped I/O ports are accessed. Such data can be used as a measure of the efficiency of the code in accomplishing a task. In the prior art, the code under test was modified to include subroutines which updated a stored count each time a selected memory address was generated. This intrusive approach is difficult to utilize because it requires an intimate knowledge of the code being tested in order to modify it. Another approach is to connect a word recognizer to the address bus of the microprocessor and to program the word recognizer to generate a pulse each time a selected address appears on the bus. The pulses are then counted by a conventional counter. This method is nonintrusive since the code under test is not modified, and is therefore often easier to perform and less prone to error. However to count memory access operations for a large number of different addresses, this method requires a large number of word recognizers and counters. The address bus of a computer under test could also be applied as a data input to a test computer which could be programmed to count occurrences of selected addresses, eliminating the need for large numbers of counters and word recognizers, but such a method would require the use of a very high speed, costly test computer.
It would therefore be useful to provide a method and apparatus which could count occurrences of a large number of different events characterized by unique numbers appearing on a bus, and then supply a continuous prescaled count to an external computer or controller.